package com.example.hetong_system.model.dto;

import com.example.hetong_system.model.Contract;
import com.example.hetong_system.model.enums.AuditStatus;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Data
public class ContractAuditDTO {
    private Long id;
    private String name;
    private String status;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    private String projectManagerName;
    private String customerCompanyName;
    private String customerContactName;
    private String customerContactInfo;

    private List<ContractClauseAuditDTO> clauses;
    private int totalClausePages;
    private long totalClauses;

    public ContractAuditDTO(Contract contract, List<ContractClauseAuditDTO> clauses,
                            int totalClausePages, long totalClauses) {
        this.id = contract.getId();
        this.name = contract.getName();
        this.status = contract.getStatus();
        this.createTime = contract.getCreateTime();
        this.updateTime = contract.getUpdateTime();
        this.projectManagerName = contract.getProjectManager().getName();
        this.customerCompanyName = contract.getCustomer().getCompanyName();
        this.customerContactName = contract.getCustomer().getContactName();
        this.customerContactInfo = contract.getCustomer().getContactInfo();
        this.clauses = clauses;
        this.totalClausePages = totalClausePages;
        this.totalClauses = totalClauses;
    }
}